local yintang = fk.CreateSkill({
  name = "js__yintang",
})

yintang:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "喑堂：与一名角色拼点",
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player and player:canPindian(to_select)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local pindian = player:pindian({target}, yintang.name)
    if pindian.results[target].winner == player then
        local ids = {}
        table.insert(ids, pindian.fromCard:getEffectiveId())
        table.insert(ids, pindian.results[target].toCard:getEffectiveId())
        ids = table.filter(ids, function(id)
        return table.contains(room.discard_pile, id) and player:canUse(Fk:getCardById(id), { bypass_times = true })
        end)
        if #ids == 0 then return end
        room:askToUseRealCard(player, {
        pattern = ids,
        skill_name = yintang.name,
        prompt = "你可以使用一张拼点牌",
        extra_data = {
            bypass_times = true,
            extraUse = true,
            expand_pile = ids,
        },
        })
    else
        local choices = {}
        for _, skill in ipairs(player:getSkillNameList()) do
        if player:hasSkill(skill) then
            table.insert(choices, skill)
        end
        end
        local choice = room:askToChoice(player, {
        choices = choices,
        skill_name = yintang.name,
        prompt = "令你的一个技能本回合失效",
        detailed = true
        })
        if choice then
        room:invalidateSkill(player, choice, "-turn", yintang.name)
        end
    end
    
  end,
})

Fk:loadTranslationTable {
["js__yintang"] = "喑堂",
[":js__yintang"] = "出牌阶段，你可以与一名角色拼点，若你：赢，你可以使用一张拼点牌；没赢，你令你的一个技能本回合失效。",
["$js__yintang1"] = "朕要看看是你的嘴硬，还是朕的铁烙硬！",
["$js__yintang2"] = "大胆令狐，朕行事岂容你指指点点！",
}
return yintang